<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/23
 * Time: 13:53
 */

namespace app\admin\controller;


use app\common\controller\AdminBase;
use other\DbManage;
use think\Db;

class Index extends AdminBase
{
    public function index()
    {
        $adminInfo = Db::name('admin')->where('id', cookie('admin'))->find();
        $article   = Db::name('article')->count();
        $posts     = Db::name('article')->where('del_status',0)->where('status', 1)->count();
        $urlPosts  = Db::name('article')->where('del_status',0)->where('status', 1)->where('url_post', 1)->count();
        return view('index', [
            'adminInfo'=>$adminInfo,
            'article'  => $article,
            'posts'    => $posts,
            'urlPosts' => $urlPosts
        ]);
    }

    public function test()
    {
        $dbManage = new DbManage();
        $list     = $dbManage->getTables();
        $res = Db::query("select * from ty_system");
        print_r($res);
    }
}